home *** CD-ROM | disk | FTP | other *** search
- /* In the name of God *
- * XYZ Mesh Creator for LightWave Modeler *
- * Author: *
- * _______________________________ *
- * * Hossein Shirdashtzadeh * *
- * * (c)1998 All rights reserved * *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
- * Purpose: *
- * Used to import XYZ data from a text file into LightWave Modeler *
- * (Please refer to the readme file comming with this script) *
- * *
- * Please send any suggestions to: *
- * Snail: *
- * No. 132, Kerdabad, *
- * Jey st., Isfahan, *
- * Iran *
- * Zip code: 81599 *
- * Email: *
- * shirdash@www.dci.co.ir *
- * *
- * --> "HSS" means: Hossein ShirdaShtzadeh *
- * Data Format: *
- * Just the first two lines of your data file must contain the *
- * number of X amd Y data points in the mesh. *
- * (See the example data file) *
- * After that you must write triples separated by a comma (,) *
- * These triples contain three floating point numbers indicating *
- * the coordinates of each mesh point in space. Note that each *
- * line contains only one triple and at the end of each line no *
- * comma is needed. (See the example data file) *
- *********************************************************************/
- options results
- ADDRESS "LWModelerARexx.port"
- libadd = addlib("LWModelerARexx.port",0)
-
-
- filename=getfilename("-- HSS MESH DATA --","Ram:" )
- if open(file,filename,'Read') then
- do
- mx= readln(file)
- my= readln(file)
- Triple = readln(file)
- x=get(Triple)
- y=get(Triple)
- z=get(Triple)
-
- call meter_begin mx, 'HSS Mesh: Reading Points...'
- call add_begin
-
- do n=1 to mx
- call meter_step
- do m=1 to my
- call add_point x y z
- Triple = readln(file)
- x=get(Triple)
- y=get(Triple)
- z=get(Triple)
- end
- end
- call meter_end
- p=0
- call meter_begin mx, 'HSS Mesh: Making Polygons...'
- do n=1 to mx
- call meter_step
- do m=1 to my
- p=p+1
- k=p-1
- if m>1 then call add_polygon p k
- l=p-my
- if l>0 then call add_polygon p l
- end
- end
- call meter_end
-
- call add_end
- end
-
- exit
-
-
- /*********************************/
- Get:
- parse arg Triple
- p=Triple
- a=pos(',',Triple)-1
- if a>0 then do
- p=left(Triple,a)
- Triple=right(Triple,length(Triple)-a-1)
- end
-
- Return p
-